package cn.tedu.spring.scope;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 订单测试类
 */
public class TestOrders {
    public static void main(String[] args) {
        //快捷键: ctrl + shift + c 复制路径
        //创建IoC容器对象
        ApplicationContext context = new AnnotationConfigApplicationContext("cn.tedu.spring.scope");
        Orders orders1 = context.getBean(Orders.class);
        //第1次获取对象
        System.out.println(orders1);

        //第2次获取对象
        Orders orders2 = context.getBean(Orders.class);
        System.out.println(orders2);
    }
}
